package com.lzp.badminton.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lzp.badminton.config.ResultMessage;
import com.lzp.badminton.model.Club;
import com.lzp.badminton.service.IClubService;
import com.lzp.badminton.vo.ClubUser;
import com.lzp.badminton.vo.ClubUserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2022-02-11
 */
@RestController
@RequestMapping("/club")
public class ClubController {
    @Autowired
    private IClubService iClubService;
    @Autowired
    private ResultMessage resultMessage;

    @GetMapping(value = "/getClubInfo")
    @ResponseBody
    public ResultMessage getActivityInfo(@RequestParam(value = "clubId") int clubId) {
        ClubUserVo result = iClubService.getClubInfoById(clubId);

        if (result == null) {
            resultMessage.fail("404", "查询不到该俱乐部");
        } else {
            resultMessage.success("200", "查询成功", result);
        }
        return resultMessage;
    }


}
